The Forking Lemma: a brief introduction
Luca Dall’Ava, 29th of September 2025
Aim of the talk: Present the main ideas behind the seminal Forking Lemma and its application to folding schemes
Table of contents
An (informal) introduction
The Forking Lemma was first introduced by Pointcheval and Stern in order to prove the security for Schnorr signatures in 1996.
Main idea: “We need a reduction”!
- We show that if an attacker (an "adversary") could break our cryptographic scheme, they could also be used as a subroutine to solve a famously hard mathematical problem (like finding a discrete logarithm).
- If we believe the underlying problem is hard, we can be confident that our scheme is secure.
Analogy:
- "If you can pick the lock on my new safe, I can use you to break into Fort Knox."
- Since we believe Fort Knox is secure, we gain confidence in my safe.
The Forking Lemma is a powerful, standardized technique for building these reductions, especially for schemes that use hash functions.
The model the Forking Lemma works in is the Random Oracle Model (ROM).
Recall that:
- In this model, we replace standard cryptographic hash functions (like SHA-256/Poseidon/Keccak256) with a perfect, publicly accessible random function—an "oracle."
- Any party can query the oracle with an input , and it will return a truly random value , consistently providing the same output for the same input.
The key advantage for a security proof is that the entity performing the reduction (the "challenger") can program the oracle, observing the adversary's queries and controlling its responses. The Forking Lemma builds on exploiting this control.
The original Forking Lemma
The Forking Lemma is essentially a structured way to "rewind" a probabilistic adversary.
Intuition
Imagine an adversary, , that takes a public key as input and, after some computation that includes making queries to a random oracle, outputs a valid digital signature forgery.
- First Execution: We run the adversary's algorithm.
- makes a query to the random oracle, say .
- We, as the challenger, answer these with the random value .
- The adversary eventually succeeds, producing a valid signature for a message . This signature is valid with respect to the hash outputs it received.
- The "Fork": What if we could turn back time?
- We "rewind" the adversary's program to the exact moment before it queried and received .
Note: We have its exact memory state, its program counter, everything!
- We "rewind" the adversary's program to the exact moment before it queried and received .
- Second Execution:
- We resume the adversary from this saved state.
- proceeds to make the same query, . This time, however, we provide a different, fresh random value as the response.
- (From this point forward, we continue answering any subsequent queries with new random values.)
- Output:
- With some non-negligible probability, the adversary, if it is robust, will succeed again and produce a second valid signature, .
The Payoff
We are now in possession of two valid signatures, and , that are related in a very specific way: they only differ because of the hash outputs, and . They share the same initial computation path but diverge at a controlled point due to our intervention with the random oracle.
This often yields a system of algebraic equations that can be solved to extract a secret (key), thereby breaking the underlying hard problem.
Classic Example: Breaking Schnorr Signature
Let's see how this works with the Schnorr signature scheme.
- Setting: A cyclic group of prime order with generator .
- Secret Key: An integer .
- Public Key: (where is the secret key)
- Signature on message :
- Choose a random nonce , compute .
- Compute the hash challenge .
- Compute .
- The signature is the pair .
- Verification Equation: .
Security Reduction using the Forking Lemma:
Assume an adversary can forge a Schnorr signature.
Our goal is to use to find the discrete logarithm of the public key .
- First iteration:
An adversary produces a valid forgery . This means it must have queried the oracle for to get a hash .
We obtain
- (Fork):
- We rewind to before it got , and give it a new hash instead.
- With some probability, it succeeds again, producing .
- Now, we obtain:
- Solving for the Secret:
- We have a system of two linear equations:
- Subtracting them gives:
- Since , we can rewrite this as:
- We can now easily solve for the secret key
- We have a system of two linear equations:
- Conclusion:
The ability to forge a Schnorr signature allows us to solve the discrete logarithm problem. Therefore, the scheme is secure.
We can think of this algorithm as of an Extractor which outputs the secret key.
The Forking Lemma for folding schemes
Recalls on Folding Schemes (Informal)
A folding scheme is a cryptographic primitive that takes two instances of a problem (for example, two R1CS/CCS instances) and folds them into a single, combined instance.
The key property is that the folded instance is satisfiable, that is, has a valid witness, if both original instances were satisfiable.
We can represent it as the following map:
- At each step, the prover doesn't generate a full, expensive proof. Instead, they use a lightweight cryptographic protocol to fold the claim of the current step's correctness into a running accumulator.
- A single, final SNARK is only generated at the very end to prove the correctness of the entire folded accumulation.
A naive take on extraction
We have seen that “the folded instance is satisfiable, that is, has a valid witness, if both original instances were satisfiable”, but
what about the other implication?
Can we use a technique like the Forking Lemma for recovering and ?
In a folding scheme, the witnesses from two separate instances are algebraically combined using the verifier's random challenge to create a new, single folded witness:
Let’s give it a try!
The Extractor's Problem:
- The extractor forks the prover and gets two successful runs with challenges and .
- It gets two valid folded witnesses, and .
But here's the catch:
- A malicious prover could have used completely different pairs and of initial witnesses in each forked run.
- The protocol only guarantees that some valid pair existed for each run.
- The extractor is left with two valid equations, but they don't share the same unknowns. It's like having:
You have two equations, but four unknowns! You can't solve this system for the original witnesses .
A modified Forking Lemma
The proof for folding schemes is a two-step process that adapts the classic lemma.
The Key Insight: The folded witness isn't just a random value; it's an algebraic polynomial of the verifier's random challenge, . The original witnesses we want to find are the coefficients of this polynomial.
- Therefore, the modern proof strategy becomes:
- Use the Forking Lemma to get the raw data we need (the tree of transcripts).
- Use algebra to reconstruct the polynomial and extract its coefficients (the witnesses).
The Two-Step Proof Strategy
The process is as follows.
Part 1: The Forking Lemma's Role (The "Meta-Theorem")
- The lemma simplifies the task enormously: we don't need to build a complex extractor that can rewind any 'live' prover in real-time.
- Instead, we only need to design a simpler extractor, let's call it , that can succeed if it's given a static tree of successful, forked transcripts.
Therefore, we can now ignore the complexities of rewinding and focus on a much cleaner algebraic problem.
Part 2: The Tree-Based Extractor's Job (The "Worker")
- This is the algorithm that does the actual extraction.
- Input:
- The tree of successful transcripts, and
- the prover's final folded witnesses from each run.
- Goal: Solve for the original witnesses, and .
- Tool: Polynomial interpolation.
The Extractor
Let’s look at how uses its input to find the witnesses (in the simplified version of a Nova-like folding scheme).
The Witness Vector
- The formula is . This is the equation of a line, where is the variable.
- To find the two unknown coefficients , we need two points on that line.
- The extractor gets these points by picking two successful transcripts from its tree with different challenges, and .
It now has a system of two linear equations it can solve:
The Error Term
We refer to The Mova protocol (a brief bescription), Folding Schemes - Recursive snarks - part 2, https://www.youtube.com/watch?v=vn-HIsG7uaA&t=14s for notation and basic definitions.
- The formula is (where is the so-called cross-term). This is the equation of a parabola.
- To find the three unknown coefficients , we need three points.
- The extractor picks three transcripts with different challenges and interpolates the unique parabola passing through them.
Because the extractor can always solve for these coefficients, any prover that can consistently succeed must have implicitly known them all along. This is the essence of the knowledge soundness proof.
Conclusion: Take-home message
- The Forking Lemma is a foundational and flexible tool for proving security.
- For modern primitives like folding schemes, it has been adapted to a new, powerful technique.
- By combining the classic rewinding argument with algebraic interpolation, we can prove knowledge soundness even for complex, compositional protocols built from folding schemes (but also, more generally, reductions of knowledge).
References
- [K23] - Komlo, C. - A Note on Various Forking Lemmas, https://www.chelseakomlo.com/assets/content/notes/Forking-Lemma-Variants.pdf
- [KP22] - Abhiram Kothapalli, Bryan Parno, "Algebraic Reductions of Knowledge," Cryptology ePrint Archive, 2022, https://eprint.iacr.org/2022/009
- [KST22] - Kothapalli, A., Setty, S., Tzialla, I.: Nova: Recursive Zero-Knowledge Arguments from Folding Schemes. In: CRYPTO (2022)
- [PS96] - Pointcheval, D., and Stern, J. (1996). - "Security Proofs for Signature Schemes." In Proceedings of the 15th Annual International Conference on Theory and Application of Cryptographic Techniques (EUROCRYPT '96).
